#include "Cell_impl.h"
#include "Entry_impl.h"

Sheet* CellImpl::GetSheet()
{
	//the pointer must be valid here.
	return m_entry->GetSheet();
}

Entry* CellImpl::GetEntry()
{
	//the pointer must be valid here.
	return m_entry;
}


CellImpl::CellImpl(EntryImpl* parent, const Variant& v)
	: m_entry(parent)
	, m_value(v)
{
}

CellImpl::~CellImpl()
{
}

int CellImpl::toInt()
{
	return m_value.toInt();
}
float CellImpl::toFloat()
{
	return m_value.toFloat();
}
const char*	CellImpl::toStr()
{
	return m_value.toStr();
}

int CellImpl::GetType()
{
	int c = GetColumn();
	return GetSheet()->GetType(c);
}

int CellImpl::GetColumn()
{
	return m_entry->GetColumn(this);
}